package com.springcloud.controller;

import cn.hutool.core.lang.Dict;
import com.springcloud.entity.Server;
import com.springcloud.payload.ServerVO;
import com.springcloud.util.ServerUtil;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * TODO (websocket通信)
 *
 * @author 肖嘉亮
 * @version 1.0
 * @date 2021/4/15 17:46
 */

@RequestMapping(value = "/server")
@RestController
public class ServerController {

    @GetMapping
    public Dict serverInfo() throws  Exception{
        Server server = new Server();
        server.copyTo();
        ServerVO serverVO = ServerUtil.wrapServerVO(server);
        return ServerUtil.wrapServerDict(serverVO);
    }

}
